export default {
	onLoad() {
		var pages = getCurrentPages();
		var page = pages[pages.length - 1];
		var full_page = page.$page.fullPath

		if (full_page.indexOf('?') > -1) {
			full_page += '&'
		} else {
			full_page += '?'
		}
		//绑定分享者id
		full_page += 'share_uid=' + this.vuex_user_id
		// console.log('current_page',full_page,page)
		// 设置默认的转发参数
		this.$u.mpShare = {
			title: '', // 默认为小程序名称
			path: full_page, // 默认为当前页面路径
			imageUrl: '' // 默认为当前页面的截图
		}
	},
	onShareAppMessage(res) {
		let pages = getCurrentPages();
		let page = pages[pages.length - 1];
		let full_page = page.$page.fullPath
		if (full_page.includes('comditydetails')) {
			full_page = `/subpkg/comditydetails/comditydetails?id=` + this.vuex_oid
		} 
		console.log('onShareAppMessage',full_page)
		return {
			title:this.vuex_Product.name,
			path: full_page,
			imageUrl:this.vuex_Product.cover_img||''
		}
	},
	// #ifdef MP-WEIXIN
	onShareTimeline() {
		console.log('onShareAppMessage', this.$u.mpShare)
		return this.$u.mpShare
	}
	// #endif
}
